/**
 * SplashScreen
 * 启动屏
 * from：http://www.devio.org
 * Author:CrazyCodeBoy
 * GitHub:https://github.com/crazycodeboy
 * Email:crazycodeboy@gmail.com
 * @flow
 */
'use strict';

import { NativeModules, Platform, } from 'react-native';

export class BarHide {
  /**
   * 隐藏状态栏
   */
  static FLAG_HIDE_STATUS_BAR = 0
  /**
   * 隐藏导航栏
   */
  static FLAG_HIDE_NAVIGATION_BAR = 1
  /**
   * 隐藏状态栏和导航栏
   */
  static FLAG_HIDE_BAR = 2
  /**
   * 显示状态栏和导航栏
   */
  static FLAG_SHOW_BAR = 3
}


export default class SplashScreen {
  static hide() {
    NativeModules.SplashScreen.hide()
  }
  static show() {
    NativeModules.SplashScreen.show()
  }
  static setBar(style, versionCode = 1004) {
    if (versionCode > 1003 && Platform.OS === 'android') {
      NativeModules.SplashScreen.setBar(style)
    }
  }
}
